using IdentityServer4.Models;
using System.Collections.Generic;

namespace Idp_Login
{
    public partial class Config
    {
        /// <summary>
        /// scopes define the resources in your system
        /// 定义身份资源
        /// 也就是用户信息,即,返回哪些用户信息
        /// </summary>
        /// <returns></returns>
        public static IEnumerable<IdentityResource> GetIdentityResources()
        {
            //定义自定义身份资源
            var customIdentityResource = new IdentityResource(
                name: "CustomIdentityResource",
                displayName: "Custom profile",
                userClaims: new List<string> { "FavoriteColor", "QQ", "Balance" }
            //claimTypes: new[] {  "FavoriteColor","QQ", "Balance" } //自定义Id资源，植入claim

            );

            return new List<IdentityResource>
            {
                //下面这2个不添加, 会导致scope错误 
                new IdentityResources.OpenId(),//最基本的, 至少要有这个 
                new IdentityResources.Profile(), //内置的额外信息, 一堆默认属性
                //补齐下面这3个, 凑齐IdentityResources内置的就5个, 前端scope可以不写,此时scope表示这里定义的所有
               
                new IdentityResources.Address(),
                new IdentityResources.Email(),
                new IdentityResources.Phone(),

                customIdentityResource,//定义自定义身份资源
               
            };
        }

    }
}
